<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户管理</title>
    <style>
        table,th,tr,td {
            border: 1px solid black;
            border-collapse: collapse;
        }
    </style>
</head>
<body>
<div>
    <div>
        <table>
            <thead>
                <tr>
                    <th>登录名</th>
                    <th>用户名</th>
                    <th>性别</th>
                    <th>出生日期</th>
                    <th>邮箱</th>
                    <th>状态</th>
                </tr>
            </thead>
            <tbody id="tbody">
            </tbody>
        </table>
    </div>
</div>
<script src="/js/jquery-3.2.1.min.js"></script>
<script>
    function initData() {
        $.ajax({
            url: '/user/list',
            type: 'GET',
            success: function (data) {
                if (data && data.length > 0) {
                    for (let i = 0; i < data.length; i++) {
                        let info = data[i];
                        $("#tbody").append(`
                            <tr>
                                <td>${info.loginname}</td>
                                <td>${info.username}</td>
                                <td>${info.sex}</td>
                                <td>${info.birthday}</td>
                                <td>${info.email}</td>
                                <td>${info.status}</td>
                            </tr>
                        `);
                    }
                }
            }
        })
    }
    initData();
</script>
</body>
</html>